package net.plankton.controller;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class NetReader implements Runnable{

	int port;
	ServerSocket socket;
	
	public NetReader(int port) {
		this.port = port;
		try {
			socket = new ServerSocket(port);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void run() {
		while (true) {
			try {
				Socket s = socket.accept();
				new CommandHandler(s).start();
			} catch (IOException e) {
				
				e.printStackTrace();
			}
		}
		
	}

	
	
}
